<!-- js validate form  -->
<script type="text/javascript">
$(document).ready(function() {
	 $("#target_2").focus(function() {
		 var target_1 = $("#target_1").val();
		 $(this).val(target_1); 
	 });
});

$(document).ready(function() {
	$("#add").validate();		
});

$.metadata.setType("attr", "validate");
</script>

<div class="content_head">
	Thêm danh mục menu trang quản trị
</div>

<form id="add" method="POST" action="<?php echo base_url()?>back_end/admin_menu/edit/<?php echo $admin_menu_value['id']; ?>">
<div class="content_ct">
   <div class="content_ct_show">
		<table class="content_ct_show_add_tbl" width="100%">
			<tr>
				<td width="15%" style="text-align:right;">
					<span>Tên danh mục: </span>
				</td>
				<td width="85%">
					<input class="required input_txt_table" name="name" value="<?php echo $admin_menu_value['name']; ?>" type="text" />
				</td>
			</tr>
			<tr>
				<td style="text-align:right;">
					<span>Danh mục cha: </span>
				</td>
				<td>
					<select class="input_sl_table" name="parent_id">
						<option vlaue="0">----------------------------------------- Danh mục cấp 1 -----------------------------------------</option>
						<?php foreach ($list_menu as $list_menu_key => $list_menu_value) {?>
							<option value="<?php echo $list_menu_key;?>" <?php if($list_menu_key ==  $admin_menu_value['root_path']){ echo 'selected=selected';} ?>>
								<?php echo $list_menu_value;?>
							</option>
						<?php }?>
					</select>
				</td>
			</tr>
			<tr>
				<td width="15%" style="text-align:right;">
					<span>Tên controller: </span>
				</td>
				<td width="85%">
					<input id="target_1" name="controller" value="<?php echo $admin_menu_value['controller']; ?>" class="input_txt_table" type="text" />
				</td>
			</tr>
			<tr>
				<td style="text-align:right;" valign="top">
					<span>Tên liên kết : </span>
				</td>
				<td>
					<input id="target_2" name="link" value="<?php echo $admin_menu_value['link']; ?>"  class="input_txt_table" type="text" />
				</td>
			</tr>
			<tr>
				<td id="lk_tag" style="text-align:right;">
					<span>Trạng thái : </span>
				</td>
				<td>
					<input type="checkbox" name="status" value="1" <?php if( $admin_menu_value['status'] == 1) { echo 'checked=checked'; } ?>/>
				</td>
			</tr>
			<tr>
				<td style="text-align:right;">&nbsp;</td>
				<td>
					<input type="submit" name="editForm" style="cursor: pointer;" value="Sửa" />
					<input type="reset" style="cursor: pointer;" value="Reset" type="checkbox" />
				</td>
			</tr>
		</table>
	</div>
</div>
</form>